<?php
        include "include/top.php"
?>

<form method="post" action="<?php $_PHP_SELF ?>">
<style>
 .regtable{width:600px;background:#fff;border-radius:5px;padding-top:30px;padding-bottom:100px}
 .regtable th{font-size:26px;color:#9c9c9c}  <!-- slightly darker than gray -->
 .regtable td{padding: 6px;}
 .regtable td a{color: green;}
 .regtable .lefttd{text-align: right;width:25%;color:gray}
 .regtable .righttd{text-align: left;width:75%}
 .regtable .text{width:58%;border: solid 1px #ddd;height:34px;line-height: 34px;background: #f5f5f5;border-radius:5px} 
<!-- #cmdLogin{width: 200px;height:40px;text-align:center;color:#fff;border:0;background: #e96481;border-radius: 5px;} -->
 #cmdLogin{width: 200px;height:40px;text-align:center;color:#fff;border:0;background: #e96481;border-radius: 5px;} 
</style>
<table class="mytable regtable">
    <tr>
      <th></th>
      <th class="righttd">Upload File</th>

    </tr>
    <tr>
      <td class="lefttd">cust_id:</td>
      <td class="righttd"><input type="text" name="cust_id" class="text"/></td>
    </tr>
    <tr>
      <td class="lefttd">Input1:</td>
      <td class="righttd"><input type="text" name="Input1" class="text"/></td>
    </tr>
    <tr>
      <td class="lefttd">File:</td>
      <td class="righttd"><input type="file" name="Input_filename" id="filename" style="display:button"/></td>
    </tr>
    <tr>
      <td class="lefttd">Input3:</td>
      <td class="righttd"><input type="text" name="Input3" class="text"/></td>
    </tr>
    <tr>
      <td></td>
      <td class="righttd">
        <input type="submit" value="Upload" name="add" id="cmdLogin"/>
      </td>
    </tr>
</table>
</form>


<?php
if(isset($_POST['add']))
{

$dbhost = 'localhost';
$dbuser = 'ospms';
$dbpass = 'ospms';
$conn = mysql_connect($dbhost, $dbuser, $dbpass);
if(! $conn )
{
  die('Could not connect: ' . mysql_error());
}

$sql = "INSERT INTO customer_file_info".
       "(cust_id, file_name, file_location, revision ) ".
       "VALUES('$cust_id', '$Input1', '$Input2', '$Input3'";
echo "$sql";
echo "<br> </br>";
mysql_select_db('OSPMS');
$retval = mysql_query( $sql, $conn );

if(! $retval )
{
  mysql_close($conn);
  die('Could not enter data: ' . mysql_error());
}
else
{
echo "Entered data successfully\n";
}

}
?>

<?php
        include "include/bottom.php"
?>
